package com.aspose.cells;

import java.util.Iterator;

class zun implements Iterator {
   private zuq a;
   private short b;
   private short c;
   private int d;
   private int e;
   private zfv f = new zfv();
   private int g;

   zun(zuq var1, int var2, int var3) {
      this.a = var1;
      this.e = var1.c();
      if (var2 < 0) {
         this.f.a = -1;
         this.g = 10;
         this.d = this.g;
         this.b = this.f.a;
         this.c = (short)var3;
      } else {
         this.f.a = (short)var2;
         this.g = var1.a(this.f, -1, (short)-1, false, false);
         if (this.g < 0) {
            this.g = this.e;
            this.d = this.g;
            this.b = -1;
            this.c = -1;
         } else {
            this.d = this.g;
            --this.f.a;
            this.b = this.f.a;
            var1.a(this.g, this.f);
            this.c = (short)var3;
         }
      }

   }

   public boolean hasNext() {
      if (this.g < this.e) {
         this.g = this.a.a(this.g, this.f);
         return this.f.a <= this.c;
      } else {
         this.f.a = -1;
         return false;
      }
   }

   public zfv a() {
      return this.f;
   }

   public Object next() {
      return this.f;
   }

   public void b() {
      this.g = this.d;
      this.f.a = this.b;
   }

   public boolean a(int var1) {
      if (this.f.a == var1) {
         return true;
      } else if (var1 < this.b) {
         this.b();
         return this.hasNext();
      } else if (var1 > this.c) {
         return false;
      } else {
         if (this.f.a > var1) {
            this.b();
         } else if (this.g == this.e) {
            return false;
         }

         this.g = this.a.a(this.g, this.f);
         if (this.f.a >= var1) {
            return this.f.a <= this.c;
         } else {
            do {
               if (this.g >= this.e) {
                  return false;
               }

               this.g = this.a.a(this.g, this.f);
            } while(this.f.a < var1);

            return this.f.a <= this.c;
         }
      }
   }

   public void remove() {
      throw new UnsupportedOperationException();
   }
}
